package com.mujin.keji.collectionsystem.common;

/**
 * 居住情况
 */
public enum LivingSituationEnum {
    wieh_parent("wieh_parent","与父母同住"),
    with_spouse("with_spouse","与配偶住"),
    wieh_parentandspouse("wieh_parentandspouse","与父母和配偶同居"),
    own("own","独住"),
    other("other","其他")
    ;

    /** 状态码 **/
    private final String code;
    /** 状态描述 **/
    private final String description;

    LivingSituationEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static String find(Integer origin) {
        if(origin == null){
            return null;
        }
        for (LivingSituationEnum frs : LivingSituationEnum.values()) {
            if ((frs.ordinal()+1) == origin) {
                return frs.getCode();
            }
        }
        return null;
    }


    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
